<?php defined( '_VALID_MOS' ) or die( 'Restricted access' );?>
<TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
  <TR valign="top">
    <TD width="150"><?php require_once( $mosConfig_absolute_path ."/administrator/components/com_jcs/menubar.php" );?></TD>
    <TD>&nbsp;</TD>
    <TD>
    <table class="adminheading">
			<tr>
				<th class="plans">
					<!--<IMG src="images/sections.png" align="middle" />-->
          Subscription Plans
				</th>
			</tr>
			</table>
      <form action="index2.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
        <TABLE class="adminlist">
        <TR>
        <Th width="10">ID</Th>
        <Th width="10"><input type="checkbox" name="toggle" value=""  onclick="checkAll(<?php echo count($rows) + 1?>);" /></Th>
        <Th width="80" colspan="2">Period</Th>
        <Th align="left">Subscription Name</Th>
        <Th width="60">Category</Th>
        <Th width="20" colspan="2">Reorder</Th>
        <Th width="20">Order</Th>
        <th width="1"><a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a></th>
        <Th width="20">Published</Th>
        <Th width="20">Subscribers</Th>
        <Th width="50">Price</Th>
        <Th width="50">Type</Th>
        </TR>
        <?php 
        $k = 0;
        $i = 0;
        $sign = JEConfig::get('general.curr');
        foreach($rows AS $k => $row)
        {
        ?>
            <TR class="<?php echo "row$k"; ?>" valign="top">
            <TD><?php echo $row->id ?></TD>
            <TD><?php echo mosCommonHTML::CheckedOutProcessing( $row, $i );?></TD>
            <TD align="right"><?php echo $row->days ?> </TD>
            <TD> <?php echo ucfirst($row->days_type) ?></TD>
            <TD><a href="index2.php?option=com_jcs&task=edit&cid[]=<?php echo $row->id ?>"><?php echo $row->name ?></a></TD>
            <td nowrap="nowrap"><a href="index2.php?option=com_categories&section=jcs_plans&task=editA&hidemainmenu=1&id=<?php echo $row->ctid?>"><?php echo $row->cname ?></a></td>
            <td><?php echo $pageNav->orderUpIcon( $k, $rows[$k-1]->catid == $row->catid ); ?></td>
            <td><?php echo $pageNav->orderDownIcon( $k, count($rows), $rows[$k+1]->catid == $row->catid ); ?></td>
            <td align="center" colspan="2">
            <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
            </td>
            <TD align="center"><?php echo mosCommonHTML::PublishedProcessing( $row, $i );?></TD>
            <TD align="right"><?php echo $row->subscr ?></TD>
            <TD align="right"><?php echo $row->price ?> <?php echo $sign ?></TD>
            <TD nowrap="nowrap"><?php 
            unset($t);
            if($row->type_category) $t[] = 'Category';
            if($row->type_component) $t[] = 'Component';
            if($row->type_user) $t[] = 'User';
            if($row->type_article) $t[] = 'Article';
            echo @implode(", ", $t);
            ?></TD>
            </TR>
        <?php
            $i++;
        $k = 1 - $k;
        }
        ?>
        <?php echo $pageNav->getListFooter(); ?>
        </TABLE>
        <INPUT type="hidden" name="section" value="#__jcs_plans" />
        <INPUT type="hidden" name="id" value="<?php echo $cid;?>">
        <input type="hidden" name="option" value="com_jcs" />
        <input type="hidden" name="task" value="" /><?php //echo $task ?>
        <input type="hidden" name="boxchecked" value="0" />
        <input type="hidden" name="hidemainmenu" value="0" />
        </form>
    
    
    </TD>
  </TR>
</TABLE>